package com.appsky.drift.adapter;

import com.appsky.drift.R;
import com.appsky.drift.api.ChatMessage;

import android.content.Context;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class ChatItem extends RelativeLayout {

	public ImageView userIcon;

	public TextView userNick;

	public TextView contentView;
	
	public ChatItem(Context context) {
		super(context);
		
	}
	
	public void show(ChatMessage chatMessage) {
		userNick.setText(chatMessage.getNick());
		String content = chatMessage.getContent();
		contentView.setText(content);
		switch (chatMessage.getSex()) {
		case 0:
			userIcon.setImageResource(R.drawable.female_head);
			break;
		case 1:
			userIcon.setImageResource(R.drawable.male_head);
			break;
		case 2:
			userIcon.setImageResource(R.drawable.secret_head);
			break;
		}
	}

}
